<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
				<script src="js/vue.js" type="text/javascript" charset="utf-8"></script>
	</head>
	<body >
		<div id="myApp">
					<span>用户名：{{name}}</span>
		</div>
	</body>
	<script>
	     new Vue({
			  el:'#myApp',
			  data:{
					name:""
			  },
			  methods:{
				 loadData:function(){
					 //从本地存储取
					 this.name=localStorage.getItem("name");
				 } 
			  },
			  mounted(){//挂载函数,相当于onload事件
				 this.loadData();
			  }
		 })
	</script>
</html>
